import request from "@/utils/request";
import {AxiosPromise} from "axios";
import {CorrelationForm, PurchasedInfo} from "@/api/correlation/types";
import {Result} from "@/model";


/**
 * 插入关联表
 * @param data 条件
 * @return id
 */
export function insertCorrelation(data: CorrelationForm): AxiosPromise<Result<null>> {
    return request({
        url: "/dome/correlation/add",
        method: "post",
        data,
    });
}

/**
 * 获取已购买的产品信息
 */
export function getPurchasedInfo(): AxiosPromise<Result<PurchasedInfo[]>> {
    return request({
        url: "/dome/correlation/getInfo",
        method: "get",
    });
}